<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set the timer callback function</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="zmqdevice.setidletimeout.html">« ZMQDevice::setIdleTimeout</a></li>
      <li style="float: right;"><a href="zmqdevice.settimertimeout.html">ZMQDevice::setTimerTimeout »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.zmqdevice.html">ZMQDevice</a></li>
    <li>Set the timer callback function</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="zmqdevice.settimercallback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZMQDevice::setTimerCallback</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">ZMQDevice::setTimerCallback</span> &mdash; <span class="dc-title">Set the timer callback function</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-zmqdevice.settimercallback-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ZMQDevice::setTimerCallback</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$cb_func</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$timeout</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$user_data</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="class.zmqdevice.html" class="type ZMQDevice">ZMQDevice</a></span></div>

  <p class="para rdfs-comment">
   Sets the timer callback function. The timer callback will be invoked after timeout has
   passed. The difference between idle and timer callbacks are that idle callback is invoked
   only when the device is idle.

   The callback function signature is callback (mixed $user_data). Added in ZMQ extension version 1.1.0.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-zmqdevice.settimercallback-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">cb_func</code></dt>

    <dd>

     <p class="para">
      Callback function to invoke when the device is idle. Returning false
      or a value that evaluates to false from this function will cause the 
      device to stop.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">timeout</code></dt>

    <dd>

     <p class="para">
      How often to invoke the idle callback in milliseconds. The idle callback is invoked
      periodically when there is no activity on the device.
      The timeout value guarantees that there is at least this amount of milliseconds between
      invocations of the callback function.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">user_data</code></dt>

    <dd>

     <p class="para">
      Additional data to pass to the callback function.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-zmqdevice.settimercallback-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   On success this method returns the current object.
  </p>
 </div>



</div></div></div></body></html>